package com.ruoyi.card.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.card.mapper.BsCardRecordMapper;
import com.ruoyi.card.domain.BsCardRecord;
import com.ruoyi.card.service.IBsCardRecordService;

/**
 * 打卡记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-07
 */
@Service
public class BsCardRecordServiceImpl implements IBsCardRecordService 
{
    @Autowired
    private BsCardRecordMapper bsCardRecordMapper;

    /**
     * 查询打卡记录
     * 
     * @param recordId 打卡记录主键
     * @return 打卡记录
     */
    @Override
    public BsCardRecord selectBsCardRecordByRecordId(Long recordId)
    {
        return bsCardRecordMapper.selectBsCardRecordByRecordId(recordId);
    }

    /**
     * 查询打卡记录列表
     * 
     * @param bsCardRecord 打卡记录
     * @return 打卡记录
     */
    @Override
    public List<BsCardRecord> selectBsCardRecordList(BsCardRecord bsCardRecord)
    {
        return bsCardRecordMapper.selectBsCardRecordList(bsCardRecord);
    }

    /**
     * 新增打卡记录
     * 
     * @param bsCardRecord 打卡记录
     * @return 结果
     */
    @Override
    public int insertBsCardRecord(BsCardRecord bsCardRecord)
    {
        bsCardRecord.setCreateTime(DateUtils.getNowDate());
        return bsCardRecordMapper.insertBsCardRecord(bsCardRecord);
    }

    /**
     * 修改打卡记录
     * 
     * @param bsCardRecord 打卡记录
     * @return 结果
     */
    @Override
    public int updateBsCardRecord(BsCardRecord bsCardRecord)
    {
        bsCardRecord.setUpdateTime(DateUtils.getNowDate());
        return bsCardRecordMapper.updateBsCardRecord(bsCardRecord);
    }

    /**
     * 批量删除打卡记录
     * 
     * @param recordIds 需要删除的打卡记录主键
     * @return 结果
     */
    @Override
    public int deleteBsCardRecordByRecordIds(Long[] recordIds)
    {
        return bsCardRecordMapper.deleteBsCardRecordByRecordIds(recordIds);
    }

    /**
     * 删除打卡记录信息
     * 
     * @param recordId 打卡记录主键
     * @return 结果
     */
    @Override
    public int deleteBsCardRecordByRecordId(Long recordId)
    {
        return bsCardRecordMapper.deleteBsCardRecordByRecordId(recordId);
    }
}
